package cn.laixueit;

import cn.hutool.core.lang.ObjectId;
import cn.laixueit.source.SourceApp;
import cn.laixueit.source.basepo.BaseEntity;
import cn.laixueit.source.mapper.SourceMapper;
import cn.laixueit.source.po.TbSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

/**
 * @author duxiang
 * @date 2024/2/26 13:56
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SourceApp.class)
public class Demo {

    @Resource
    private SourceMapper sourceMapper;

    @Test
    public void t(){
        int i = sourceMapper.insert(TbSource.builder().id(ObjectId.next()).name("name").build());
        System.out.println(i);
    }

    @Test
    public void t2(){
        String value = BaseEntity.AutoInsertField.updateTime.getValue();
        System.out.println(value);
    }
}
